import { VNode, createVNode } from "vue";
import { Layout } from "../type";
import DataQueryLayoutVue from "./data-query-layout.vue";
interface DataQueryLayoutConf {
  /** 是否自动计算页面高度 */
  autoHeight?: boolean;
}

export class DataQueryLayout implements Layout {
  private conf: DataQueryLayoutConf | undefined;
  constructor(conf?: DataQueryLayoutConf) {
    if (conf) {
      this.conf = conf;
    }
  }
  /**
   * 获取布局的layout
   * @param form 表单的VNode
   * @param table 表格的VNode
   * @returns
   */
  getVNode(form: VNode, table: VNode): VNode {
    return createVNode(DataQueryLayoutVue, { ...this.conf }, { form, table });
  }
}
